#pragma once

#include <assert.h>

#include <list>
#include <unordered_map>
#include <vector>

#include "entity.h"

class MapGrid {
 public:
  MapGrid(uint32_t index, uint32_t status);
  ~MapGrid();

  void Init(uint32_t status);
  void SetStatus(uint32_t status);
  uint32_t GetStatus() const { return status_; }

  bool CheckStatus(uint32_t check_type) const;

  bool AddEntity(EntityPtr entity);
  void RemoveEntity(uint64_t id);

  const std::list<EntityPtr>& GetEntities() const { return entities_; };

  inline uint32_t GetIndex() { return index_; }

  std::string ToString() const;

  void OnEndRegion();
 private:
  uint32_t index_;
  uint32_t status_;
  std::list<EntityPtr> entities_;
};